package com.lc.recovery.ui.activity.businesshome;

import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.lc.recovery.R;
import com.lc.recovery.app.AppActivity;
import com.lc.recovery.http.request.MemberOrderShowApi;
import com.lc.recovery.http.response.MemberOrderShowBean;

import butterknife.BindView;
import butterknife.ButterKnife;

public class BusinessWarehousingDetailsActivity extends AppActivity {


    @BindView(R.id.tv_status)
    TextView tvStatus;
    @BindView(R.id.ll_bg)
    LinearLayout llBg;
    @BindView(R.id.tv_date)
    TextView tvDate;
    @BindView(R.id.tv_type)
    TextView tvType;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_weight)
    TextView tvWeight;
    @BindView(R.id.tv_price)
    TextView tvPrice;
    private String shop_id;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_businesswarehousingdetails;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
        shop_id = getIntent().getStringExtra("id");

        orderShow();
    }

    private void orderShow() {
        EasyHttp.post(this)
                .api(new MemberOrderShowApi().setId(shop_id)).request(new HttpCallback<MemberOrderShowBean>(this) {

            @Override
            public void onSucceed(MemberOrderShowBean data) {
                if (data.getCode() == 200) {
                 tvStatus.setText(data.getData().getWorker());
                    tvDate.setText(data.getData().getCreate_time());
                    tvType.setText(data.getData().getShops());
                    tvWeight.setText(data.getData().getWeights());
                    tvPrice.setText("实付款：￥"+data.getData().getAmount());

                } else {
                    toast(data.getMsg());
                }
            }


            @Override
            public void onFail(Exception e) {
//                super.onFail(e);

            }
        });
    }
}
